#include <catch2/catch.hpp>

#include <cmath>

#include "solution.hpp"

using namespace solution_040;

TEST_CASE("40. Combination Sum II", "[040]") {

SECTION("example 1") {
    std::vector candidates{10,1,2,7,6,1,5};
    std::vector< std::vector<int> > ans{{1,1,6},{1,2,5},{1,7},{2,6}};
    CAPTURE(candidates);
    CHECK(Solution().combinationSum2(candidates, 8) == ans);

}

SECTION("example 2") {
    std::vector candidates{2,5,2,1,2};
    std::vector< std::vector<int> > ans{{1,2,2},{5}};
    CAPTURE(candidates);
    CHECK(Solution().combinationSum2(candidates, 5) == ans);
}

}
